package cn.iocoder.yudao.module.enterprise.dal.mysql.reductionscene;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.enterprise.controller.admin.reductionscene.vo.ReductionScenePageReqVO;
import cn.iocoder.yudao.module.enterprise.dal.dataobject.reductionscene.ReductionSceneDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 减排场景 Mapper
 *
 * @author StevenShen
 */
@Mapper
public interface ReductionSceneMapper extends BaseMapperX<ReductionSceneDO> {

    default PageResult<ReductionSceneDO> selectPage(ReductionScenePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ReductionSceneDO>()
                .likeIfPresent(ReductionSceneDO::getName, reqVO.getName())
                .orderByDesc(ReductionSceneDO::getId));
    }

}
